<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>OOP in PHP</title>
<?php include("favorite-service-adapter.php"); ?>
</head>
<body>
<?php

$adapter = new FavoriteServiceAdapter();
if ($_GET['rem']) {
  $code = $adapter->Remove($_GET['m'], $_GET['a']);
  echo 'code=' . $code;
} else if ($_GET['mf']) {
  $favs = $adapter->GetMemberFavoriteArticles($_GET['m']);
  print_r($favs);
} else if ($_GET['af']) {
  $favs = $adapter->GetArticleFavoriteMembers($_GET['a']);
  print_r($favs);
} else {
  $code = $adapter->Add($_GET['m'], $_GET['a']);
  echo 'code=' . $code;
}

?>
</body>
</html>

